<template>
	<el-upload v-model:file-list="fileList" class="upload-demo" action="http://localhost:8080/readexcel"
		:on-success="successupload">
		<el-button type="primary">上传</el-button>
	</el-upload>
	<el-button type="primary" @click="downloadexcel">导出excel</el-button>
	<hr>
	 <el-table :data="tableData" style="width: 100%">
	    <el-table-column prop="0" label="id" width="180" />
	    <el-table-column prop="1" label="Name" width="180" />
	    <el-table-column prop="2" label="Address" />
	    <el-table-column prop="3" label="Address" />
	  </el-table>
</template>
<script lang="ts" setup>
	import { ref } from 'vue'
	import { ElMessage, ElMessageBox } from 'element-plus'
	import type { UploadProps, UploadUserFile } from 'element-plus'

	const fileList = ref<UploadUserFile[]>([
	])
	const tableData=ref([])

	const successupload = (a, b, c) => {
		console.log(a.data.excellist)
		tableData.value=a.data.excellist
	}
	
	function downloadexcel(){
		window.location.href="http://localhost:8080/downloadexcel"
	}
</script>